﻿namespace PowerSong.UserInterface.Tasks
    {
    using System;

    public class RecreateIndexTask : Task
        {

        public RecreateIndexTask()
            : base("Recreating the song index...", "Updating index...")
            {
            }

        public override void Execute()
            {
            State.RecreateIndex();
            }

        public override void HandleException(Exception ex)
            {
            Utilities.ShowErrorMessage("Cannot Recreate Song Index",
                                       "An error occurred recreating the song index. Please do this manually from the PowerSong Configuration window.",
                                       "The following error occurred:",
                                       ex.Message);
            }

        }

    }
